﻿/// <summary>** BEGIN LICENSE BLOCK *****
/// Version: LGPL 3
/// 
/// Copyright 2008 David Cumps <david@cumps.be>
/// 
/// This file is part of ArmoryLib2.
///
/// ArmoryLib is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Lesser General Public License as published by
/// the Free Software Foundation, either version 3 of the License, or
/// (at your option) any later version.
///
/// ArmoryLib is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
/// GNU Lesser General Public License for more details.
///
/// You should have received a copy of the GNU Lesser General Public License
/// along with ArmoryLib2.  If not, see <http://www.gnu.org/licenses/>.
/// **** END LICENSE BLOCK ****
/// </summary>

namespace ArmoryLib2.Character.StatsDetail
{
    // <spirit base="57" effective="57" healthRegen="20" manaRegen="-1"/>
    public class Spirit
    {
        private int _healthRegen;
        public int HealthRegen
        {
            get { return _healthRegen; }
            private set { _healthRegen = value; }
        } // hp regen ooc
        private int _manaRegen;
        public int ManaRegen
        {
            get { return _manaRegen; }
            private set { _manaRegen = value; }
        } // Mp5 / 5second rule
        private int _baseSpirit;
        public int BaseSpirit
        {
            get { return _baseSpirit; }
            private set { _baseSpirit = value; }
        }

        private int _effectiveSpirit;
        public int EffectiveSpirit
        {
            get { return _effectiveSpirit; }
            private set { _effectiveSpirit = value; }
        }

        internal Spirit(int health, int mana, int baseStat, int effectiveStat)
        {
            HealthRegen = health;
            ManaRegen = mana;
            BaseSpirit = baseStat;
            EffectiveSpirit = effectiveStat;
        }

        public override string ToString()
        {
            return string.Format("Base: {0}, Effective: {1}, Health Regen Out Of Combat: {2}{3}",
                                 BaseSpirit,
                                 EffectiveSpirit,
                                 HealthRegen,
                                 (ManaRegen != -1) ? string.Format(", Mana Regen Per 5 Seconds, 5 Seconds Rule: {0}", ManaRegen) : "");
        }
    }
}
